473,440 Members | 1,741 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,440 software developers and data experts.

Problem with overflow on inline list

Hi All,

I'm trying to present a list of short text items in an inline style,
flowing over more than one line if necessary. Each item should be in a
fixed-width box. The following code does most of what I want except
for the fact that the list item width isn't honoured and the items
that flow onto the second and subsequent lines actually overlap the
first line (because the top-margin isn't being honoured).

<html>
<head>
<title>Joblist</title>
<style>

#joblist {
list-style: none;
margin-left: 5%;
width: 80%;
border: 1px solid #ccc;
padding: 5px 5px;
}

#joblist li {
display: inline;
border: 1px solid gray;
background-color: #eee;
padding: 2px 5px;
margin: 2px 5px;
width: 75px;
}

</style>
</head>
<body>

<ul id="joblist">
<li>FTD21</li>
<li>MSD10</li>
<li>SAD01</li>
<li>SAD13</li>
<li>SAD59</li>
<li>SAD64</li>
<li>SAD69</li>
<li>SAD70</li>
<li>SKD*</li>
<li>SKW*</li>
<li>STD63</li>
<li>STD64</li>
<li>TRD04</li>
<li>TRD07</li>
<li>TRD19</li>
<li>RMD196</li>
</ul <!-- joblist -->

</body>
</html>

If you remove the "display: inline;" instruction you'll see the kind
of effect I'm after but without the actual inline behaviour.

Can anyone suggest a reason why I'm getting this result?

Thanks

Steve

Apr 4 '07 #1
2 3071
Scripsit st***********@tesco.net:
The following code does most of what I want except
for the fact that the list item width isn't honoured
According to CSS specifications, the width property does not apply to inline
elements.

As a workaround, set float: left for the list items, and set clear: both for
the element after the list.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Apr 4 '07 #2
Jukka K. Korpela wrote:
Scripsit st***********@tesco.net:
>The following code does most of what I want except
for the fact that the list item width isn't honoured

According to CSS specifications, the width property does not apply to
inline elements.

As a workaround, set float: left for the list items, and set clear: both
for the element after the list.

If you use float left you'll probably lose the border in #joblist

#joblist {
list-style: none;
margin-left: 5%;
border: 1px solid #ccc;
padding: 5px 5px;
}
Apr 4 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: zz | last post by:
Sorry for posting this here but unfortunatly I couldn't find any appropriate newsgroup for this and since I've been active here with .net question I figured you guys might be able to help. ...
1
by: books1999 | last post by:
Hi there, I have a problem with this css/div and i cannot work it out. I would like either container to be able to push the background box to grow but in Firefox it overflows. Can someone find a...
2
by: george.leithead | last post by:
Hi all, I have a very strange problem! In following Web page (which is generated from a CMS System), the navigation to the left 'dissapears' when you roll the mouse over the links? It does not...
7
by: Nik | last post by:
I'm trying to combine css-popups with an images-in-inline-lists gallery. The problem I see with http://www.niksally.f2s.com/upload/gallery/gallery.html is that the images jog when the mouse...
0
by: whairs01 | last post by:
Could someone help me and telling me how to get my 3 column web page to resize correctly in IE7. When trying to reside my my web page I can only get it to resize to a point before the 2 and 3...
1
by: rirby2 | last post by:
Hi everyone, I'm currently having a rendering problem in IE7 (haven't even tried the lower IEs yet), vs. what I see in FF2. The simplified site can be found at solerasd.com . (There are more...
8
by: Martin the Third | last post by:
Hi, I need some help! I'm writing an infinite-precision floating point library called ipfloat (I know infinite is a misnomer - but arbitrary was taken). A quick overview: I'm storing numbers as...
42
by: thomas.mertes | last post by:
Is it possible to use some C or compiler extension to catch integer overflow? The situation is as follows: I use C as target language for compiled Seed7 programs. For integer computions the C...
1
by: innivive | last post by:
I am having a problem with having margins display correctly in IE7, Firefox and Safari. I am not sure if it is the "double margin error" or something else. Any help would be appreciated. The file...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.